using System;

namespace Arcane.Source.TileMatch;

[Flags]
public enum TileSide
{
    None = 0,
    Right = 1,
    Top = 2,
    Left = 4,
    Bottom = 8,
    All = 15,
}

public static class TileSideExt
{
    public static TileSide Without(this TileSide side, TileSide other)
    {
        return side & ~other;
    }

    public static TileSide Exclude(this TileSide side)
    {
        return TileSide.All.Without(side);
    }

    public static TileSide Oppsite(this TileSide side) 
    {
        return (TileSide)(((int)side << 2) | ((int)side >> 2)) & TileSide.All;
    }
}